package com.college.eduService.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
    * 课程
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "edu_course")
public class EduCourse {
    /**
     * 课程ID
     */
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /**
     * 课程讲师ID
     */
    @TableField(value = "teacher_id")
    private String teacherId;

    /**
     * 课程专业ID
     */
    @TableField(value = "subject_id")
    private String subjectId;

    @TableField(value = "subject_parent_id")
    private String subjectParentId;

    /**
     * 课程标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 课程销售价格，设置为0则可免费观看
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 总课时
     */
    @TableField(value = "lesson_num")
    private Integer lessonNum;

    /**
     * 课程封面图片路径
     */
    @TableField(value = "cover")
    private String cover;

    /**
     * 销售数量
     */
    @TableField(value = "buy_count")
    private Long buyCount;

    /**
     * 浏览数量
     */
    @TableField(value = "view_count")
    private Long viewCount;

    /**
     * 乐观锁
     */
    @TableField(value = "version")
    @Version
    private Long version;

    /**
     * 课程状态 Draft未发布  Normal已发布
     */
    @TableField(value = "status")
    private String status;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @TableField(value = "is_deleted")
    @TableLogic//逻辑删除
    private Byte isDeleted;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified",fill =FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /**
     * 评论条数
     * 不映射到数据库
     */
    @TableField(exist = false)
    private int commentNum;
    /**
     *  最近播放时间
     * 不映射到数据库
     */
    @TableField(exist = false)
    private Date playDate;
}